<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8" />
		<meta name="viewport"
			content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<title></title>
		<link rel="stylesheet" type="text/css" href="css/antd.css" />
		<style type="text/css">
			#app {
				width: 300px;
				margin: 0 auto;
				padding: 15px;
				border: 1px solid #888;
			}
		</style>
	</head>
	<body>
		<div id="app">
			<a-tree checkable v-bind="attrs" @select="this.onSelect" @check="this.onCheck"> </a-tree>
		</div>

		<script src="js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script src="js/antd.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var vm = new Vue({
				el: "#app",
				data: {
					attrs: {
						treeData: [{
								//节点对象数组，可以包含子节点
								title: "国内新闻",
								key: "new1",
								children: [{
									title: "社会新闻",
									key: "new1-1"
								}, {
									title: "社会新闻",
									key: "new1-2"
								}]
							},
							{
								title: "国内新闻",
								key: "new2",
								children: [{
									title: "社会新闻",
									key: "new2-1"
								}, {
									title: "社会新闻",
									key: "new2-2"
								}]
							}
						],
						defaultExpandedKeys: ["new1", "new2"],
						defaultCheckedKeys: ["new1-2", "new2-2"]
					}
				},
				methods: {
					onSelect(selectedKeys, info) {
						console.log("selected", selectedKeys, info)
					},
					onCheck(checkedKeys, info) {
						console.log("onCheck", checkedKeys, info)
					},
				}
			});
		</script>
	</body>
</html>
